home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 15
/
015.d81
/
pps #37
< prev
next >
Wrap
Text File
|
2022-08-26
|
5KB
|
285 lines
======================================
PEEKs, POKEs, & SYSes -- Part 37
By James Gelatin Weiler
and Ailing Gardner
======================================
Last time we told you that next
time we hoped to have a version of
the SYSPLOTTER routines that would
draw lines. This time we can tell
you that we really do have what we
told you last time we would have next
time.
For everyone who wasn't with us
last time, here's a reprise of what
you missed:
SYSPLOTTER is a set of machine
language routines that make
high-resolution graphics work easily
and quickly from within a BASIC
program. There are commands to turn
graphics on and off, to change the
background and pen color, to draw or
erase points, and to clear the whole
high-resolution screen.
Now SYSPLOTTERB adds commands to
draw horizontal and vertical lines.
Here, again, is the complete list of
commands available:
======================================
Bit-mapped graphics: how to do it
using the SYSPLOTTERB routines.
- - - - - - - - - - - - - - - - - - -
First, load the routines:
3 IFL=0THENL=1:LOAD"SYSPLOTTERB.O",8,1
After that, it gets simple fast.
A. SETGRAPHIC
To set the bit mapped graphics
mode, SYS 49152.
B. CLEARGRAPHIC
To clear the graphics screen,
SYS 49158.
C1.COLORSMEAR
To set the background color,
SYS 49161, <0-15>.
C2.PLOTCOLOR
To set the "pen" color,
SYS 49164, <0-15>.
D1.DRAW
To plot a point,
SYS 49167, <0-319>, <0-199>.
D2.ERASE
To erase a point,
SYS 49170, <0-319>, <0-199>.
E1.HRIZLINE
To plot a horizontal line,
SYS 49176,<0-319>,<0-319>,<0-199>
E2.VERTLINE
To plot a vertical line,
SYS 49173,<0-199>,<0-199>,<0-319>
F. UNGRAPHIC
To turn off the graphics screen
and return to the text screen,
SYS 49155.
======================================
Now the details.
SETGRAPHIC (49152), UNGRAPHIC (49155),
and CLEARGRAPHIC (49158) are just
simple SYSes.
SETGRAPHIC turns on the bit-mapped
graphic screen with a base address
of 8192.
UNGRAPHIC turns on the normal text
screen.
CLEARGRAPHIC erases any bit-mapped
pattern on the high-resolution
screen. It is equivalent to poking
zeros into all memory locations from
8192 to 16191.
- - - - - - - - - - - - - - - - - - -
COLORSMEAR (49161) & PLOTCOLOR (49164)
are SYSes that must be followed by a
comma and one numeric expression.
The numeric expression should
evaluate from 0 to 15. It selects the
color of the background or pen for the
entire screen. The numeric expression
can be a constant, a variable, or
an expression.
Examples:
COLORSMEAR --
SYS 49161,2
will change the backgrond color of
the entire screen to red.
PLOTCOLOR --
Z = 0: SYS 49164,Z
will change the color of all the
plotted points on the screen to
black.
- - - - - - - - - - - - - - - - - - -
DRAW (49167) and ERASE (49170) are
SYSes that must be followed by two
numeric expressions separated by
commas. The first expression is
the horizontal position to plot and
should be in the range 0 to 319.
The second expression is the vertical
position and should be from 0 to 199.
Examples:
-- DRAW --
FOR A = 0 to 20
SYS 49167,A,A
NEXT A
will draw a short diagonal line in
the upper left corner of the screen.
-- ERASE --
FOR A = 0 to 10
SYS 49170,A*2,A*2
NEXT A
will turn the diagonal line we drew
in the previous example into a dotted
line by turning off every other dot
along its length. Erase will turn
off any dot, but you won't see it
working unless the dot was already
on.
- - - - - - - - - - - - - - - - - - -
HRIZLINE (49176) and VERTLINE (49173)
are SYSes that must be followed by
three numeric expressions separated
by commas.
In HRIZLINE, the first and second
expressions are the left and right
points of the line. The lesser will
always be used as the leftmost point.
If the first two expressions are
equal, HRIZLINE will plot a single
point. The last expression is the
vertical position of the line.
In VERTLINE, the first and second
expressions are the top and bottom
points of the line. The lesser will
always be used as the top point. If
the first two expressions are equal,
VERTLINE will plot a single point.
The last expression is the horizontal
position of the line.
======================================
The machine-language SYSPLOTTERB
routines are on Side 2 of this issue
of LOADSTAR. They were written by
Ailing Gardner with the MERLIN
assembler. James Gelatin Weiler has
written a BASIC program to
demonstrate the SYSPLOTTERB routines.
The demo program includes a
subroutine to print numbers and
letters on the high-resolution screen
to aid in graph making.
If you wish to view the SYSPLOTTERB
\oad"plottext b demo",8
demo, press the '\' key now.
--------< end of article >-----------